package com.example.aop.service.impl;

import com.example.aop.annotation.Log;
import com.example.aop.service.HelloService;
import org.springframework.stereotype.Service;

/**
 * @author: qilongxin
 * @date: 2021/8/12 18:08
 */
@Service
public class HelloServiceImpl implements HelloService {

    @Log("自定义注解，拦截请求")
    @Override
    public String sayHello(String name) {
        if (name == null || "".equals(name.trim())) {
            throw new RuntimeException("The name is null!");
        }
        return "HelloService welcome to this page: " + name;
    }
}
